﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using backoffice.Data;
using System.Linq.Expressions;

namespace backoffice.Business
{
    public class BusinessPathology
    {
        #region Create
        public static void createPathology(Pathology p)
        {
            try
            {
                dataPathology.createPathology(p);
            }
            catch (Exception e)
            {
                Messages.AddDebug(e.Message);
                throw new Exception("Error creating pathology");
            }
        }

        public static void createPathology(String name, String description)
        {
            try
            {
                Pathology p = new Pathology();
                p.Name = name;
                p.Description = description;

                dataPathology.createPathology(p);
            }
            catch (Exception e)
            {
                Messages.AddDebug(e.Message);
                throw new Exception("Error creating pathology");
            }
        }
        #endregion

        #region Get
        public static Pathology getPathology(Guid guid)
        {
            try
            {
                return dataPathology.getPathology(guid);
            }
            catch (Exception e)
            {
                Messages.AddDebug(e.Message);
                throw new Exception("Error getting pathology");
            }
        }
        #endregion

        #region Set
        public static Boolean changePathology(Pathology p)
        {
            try
            {
                return dataPathology.changePathology(p);
            }
            catch (Exception e)
            {
                Messages.AddDebug(e.Message);
                throw new Exception("Error changing pathology");
            }
        }
        #endregion

        #region Delete
        public static Boolean deletePathology(Pathology p)
        {
            try
            {
                return dataPathology.deletePathology(p);
            }
            catch (Exception e)
            {
                Messages.AddDebug(e.Message);
                throw new Exception("Error deletting pathology");
            }
        }
        #endregion
    }
}
